define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'store.pink_config/index',
        add_url: 'store.pink_config/add',
        edit_url: 'store.pink_config/edit',
        delete_url: 'store.pink_config/delete',
        export_url: 'store.pink_config/export',
        modify_url: 'store.pink_config/modify',
    };

    var Controller = {
        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {field: 'id', title: 'id'},
                    {field: 'pink_name', title: '拼团名称',search: false},
                    {field: 'goods_name', title: '商品名称'},
                    {field: 'goods_img', title: '拼团图片',search: false, templet: ea.table.image,minWidth: 80},
                    {field: 'goods_price', title: '原价',search: false},
                    {field: 'pink_price', title: '拼团价',search: false},
                    {field: 'pink_people', title: '拼团人数',search: false},
                    {field: 'pink_pay_num', title: '限量',search: false},
                    {field: 'end_time', title: '结束时间',search: false},
                    {field: 'pink_status', title: '拼团状态',templet: ea.table.switch,filter: 'pink_status',search: 'select',selectList: {0: '开启', 1: '关闭'}},//[0:开启，1:关闭]
                    {width: 250, title: '操作', templet: ea.table.tool},
                ]],
            });
            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});